package com.rayboo.example.design.pattern.command;

/**
 * 命令模式
 *
 * http://c.biancheng.net/view/1380.html
 */
public class Main {

    public static void main(String[] args) {
        Stock stock1 = new Stock("ABC", 100);
        BuyOrder buyOrder = new BuyOrder(stock1);

        Stock stock2 = new Stock("ABC", 80);
        SellOrder sellOrder = new SellOrder(stock2);

        Broker broker = new Broker();
        broker.takeOrder(buyOrder);
        broker.takeOrder(sellOrder);
        broker.placeOrders();
    }
}
